package jiyun.com.yiyanmeng;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;

import java.util.ArrayList;
import java.util.List;

import bean.LunTanOffRecyBean;

public class OffLunTanDetailsActivity extends AppCompatActivity {

    /**
     * 返回
     */
    private TextView mImageBack;
    /**  */
    private TextView mTvTitle;
    private RecyclerView mRv;
    private List <LunTanOffRecyBean.InfoBean.PlateBean> list;
    private List <LunTanOffRecyBean.InfoBean.ArticleBean> bottom;
    private ImageView mIv;
    /**
     * 123
     */
    private TextView mTv1;
    /**
     * 13
     */
    private TextView mTv3;
    private int position;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_off_lun_tan_details);
        //官方论坛 top集合
        list = (List <LunTanOffRecyBean.InfoBean.PlateBean>) getIntent().getSerializableExtra("list");
        position = getIntent().getIntExtra("position", 0);
        initView();
        initData();
    }

    private void initData() {
        //top
        Glide.with(this).load(list.get(position).getImage()).into(mIv);
        mTv1.setText(list.get(position).getTitle());
        mTv3.setText(list.get(position).getNum());
        //bottom
        mRv.setLayoutManager(new LinearLayoutManager(OffLunTanDetailsActivity.this));
        bottom=new ArrayList <>();

    }

    private void initView() {
        mImageBack = (TextView) findViewById(R.id.image_back);
        mImageBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        mTvTitle = (TextView) findViewById(R.id.tv_title);
        mRv = (RecyclerView) findViewById(R.id.rv);
        mTvTitle.setText("官方论坛详情");
        mIv = (ImageView) findViewById(R.id.iv);
        mTv1 = (TextView) findViewById(R.id.tv1);
        mTv3 = (TextView) findViewById(R.id.tv3);
    }

}
